package com.xgpro.pc.archives.controller;


import com.xgpro.common.results.ResponseResult;
import com.xgpro.pc.archives.service.ExcelImportService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletResponse;

@RestController
@CrossOrigin(allowCredentials="true")
@RequestMapping("/excel")
public class ExcelImportController {

    @Autowired
    private ExcelImportService excelImportService;

    @PostMapping("/rank/import")
    public ResponseResult rankimpotr(@RequestParam("file") MultipartFile file){
        return excelImportService.rankImpotr(file);
    }

    //绩效
    @PostMapping("/per/import")
    public ResponseResult perImpotr(@RequestParam("file") MultipartFile file){
        return excelImportService.perImpotr(file);
    }


    //职称
    @PostMapping("/title/import")
    public ResponseResult titleImpotr(@RequestParam("file") MultipartFile file){
        return excelImportService.titleImpotr(file);
    }

    //项目
    @PostMapping("/project/import")
    public ResponseResult projectImpotr(@RequestParam("file") MultipartFile file){
        return excelImportService.projectImpotr(file);
    }

    //专利
    @PostMapping("/patent/import")
    public ResponseResult patentImpotr(@RequestParam("file") MultipartFile file){
        return excelImportService.patentImpotr(file);
    }

    //六西格玛
    @PostMapping("/six/import")
    public ResponseResult sixImpotr(@RequestParam("file") MultipartFile file){
        return excelImportService.sixImpotr(file);
    }

}